﻿#ifndef JISTDOCUMENTHANDLER_H
#define JISTDOCUMENTHANDLER_H

#include <QObject>
#include "JistDocument.h"
class QAction;
//class JistDocument;

class JistDocumentHandler : public QObject
{
    Q_OBJECT
public:
    explicit JistDocumentHandler(QObject *parent, JistDocument* doc);
    ~JistDocumentHandler();
    static JistDocumentHandler *instance() { return m_pInstance; }

    void retranslateUi();

    void setDocument(JistDocument *document);
    JistDocument *getDocument() const { return m_pDocument; }
    void SyncAllObject();
    QAction* setAction(const char *in, const char *asignal,
                                        const QObject * receiver, const char * method);
    // 리스트뷰의 컨텍스트 메뉴
    QAction *actionAddImage() const { return mActionAddImage; }
    QAction *actionDeleteImage() const { return mActionDeleteImage; }
    QAction *actionFakeBmp() const { return mActionFakeBmp; }
    QAction *actionAddAnimation() const { return mActionAddAnimation; }
    QAction *actionSetAniName() const { return mActionSetAniName; }
    QAction *actionAddScene() const { return mActionAddScene; }

    QAction *actionAddCell() const { return mActionAddCell; }
    QAction *actionSetUIOptCut_WW() const { return mActionSetUIOptCut_WW; }
    QAction *actionSetUIOptCut_WH() const { return mActionSetUIOptCut_WH; }
    QAction *actionSetUIOptCut_NW() const { return mActionSetUIOptCut_NW; }
    QAction *actionSetUIOptCut_NH() const { return mActionSetUIOptCut_NH; }

    QAction *actionAddEmptyCell() const { return mActionAddEmptyCell; }
    QAction *actionDeleteSprite() const { return mActionDeleteSprite; }
    QAction *actionMoveSpriteUp() const { return mActionMoveSpriteUp; }
    QAction *actionMoveSpriteDown() const { return mActionMoveSpriteDown; }

    // 애니메이션
    QAction *actionMoveAniUp() const { return mActionMoveAniUp; }
    QAction *actionMoveAniDown() const { return mActionMoveAniDown; }
    QAction *actionCopyAni() const { return mActionCopyAni; }
    QAction *actionDeleteAni() const { return mActionDeleteAni; }
    // 신
    QAction *actionMoveSceneUp() const { return mActionMoveSceneUp; }
    QAction *actionMoveSceneDown() const { return mActionMoveSceneDown; }
    QAction *actionCopyScene() const { return mActionCopyScene; }
    QAction *actionDeleteScene() const { return mActionDeleteScene; }
    // 셀
    QAction *actionMoveLayerUp() const { return mActionMoveLayerUp; }
    QAction *actionMoveLayerDown() const { return mActionMoveLayerDown; }
    QAction *actionCopyCellItem() const { return mActionCopyCell; }
    QAction *actionDeleteCellItem() const { return mActionDeleteCell; }

//private:


    QAction *mActionAddImage;
    QAction *mActionDeleteImage;
    QAction *mActionSetImgName;
    QAction *mActionFakeBmp;
    QAction *mActionMoveImgUp;
    QAction *mActionMoveImgDown;

    QAction *mActionAddAnimation;
    QAction *mActionSetAniName;
    QAction *mActionAddScene;

    QAction *mActionAddCell;
    QAction *mActionAddEmptyCell;
    QAction *mActionSetUIOptCut_WW;
    QAction *mActionSetUIOptCut_WH;
    QAction *mActionSetUIOptCut_NW;
    QAction *mActionSetUIOptCut_NH;
    QAction *mActionAddShadowCell;

    QAction *mActionDeleteSprite;
    QAction *mActionMoveSpriteUp;
    QAction *mActionMoveSpriteDown;
    QAction *mActionSetUIOptWider;
    QAction *mActionSpriteListRefine;
    QAction *mActionAddEmptySprite;

    QAction *mActionMoveAniUp;
    QAction *mActionMoveAniDown;
    QAction *mActionCopyAni;
    QAction *mActionDeleteAni;

    QAction *mActionCopyScene;
    QAction *mActionDeleteScene;
    QAction *mActionMoveSceneUp;
    QAction *mActionMoveSceneDown;
    QAction *mActionSetSceneName;

    QAction *mActionMoveLayerUp;
    QAction *mActionMoveLayerDown;
    QAction *mActionCopyCell;
    QAction *mActionDeleteCell;
    QAction *mActionSetCellName;

    QAction *mActionChangeSelection;
    QAction *mActionExchangeSprite;

    QAction *mActionClearColision;

    JistDocument *m_pDocument;
    static JistDocumentHandler *m_pInstance;

signals:


public slots:
    void addAnimation();
    void addScene();
    void addCell();
    void addEmptyCell();
    void addShadowCell();
    void removeSprite();
    void removeSprite_Fast();
};

#endif // JISTDOCUMENTHANDLER_H
